package com.example.springapp.controller;

import com.example.springapp.entity.Manual;
import com.example.springapp.service.ManualService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class ManualController {
    @Resource
    private ManualService manualService;

    @RequestMapping(value = "/updateManual", method = RequestMethod.POST)
    public Integer updateManual(@RequestBody Manual manual) {
        manualService.updateManual(manual);
        return manual.getId();
    }

    @RequestMapping(value = "/queryManuals", method = RequestMethod.POST)
    public List<Manual> queryManuals() {
        return manualService.queryAll();
    }
}
